﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestAjaxJQuery.aspx.cs" Inherits="WebApplication2.TestAjaxJQuery" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>JQuery test page</title>
    <style type="text/css">
        th
        {
            text-align: left;
        }
        .headerRow
        {
            background-color: #000000;
            color: White;
            font-weight: bold;
        }
        .highlightRow
        {
            background-color: #dadada;
            cursor: pointer;
            border: solid 1px black;
        }
        .selectedRow
        {
            background-color: #808080;
            cursor: pointer;
            border: solid 1px black;
            color: White;
        }
    </style>
    <script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#Button1").click(function () {

                $.ajax({
                    type: "POST",
                    url: "/DateWebService.asmx/GetDateTime",
                    data: "{}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (msg) {
                        $("#output").text(msg.d);
                        alert(msg.d);
                    }
                });
            });
        }); 
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <input id="Button1" type="button" value="Get Date and Time" />
    <br />
    <br />
    <span id="output" />
</form>
</body>
</html>
